
Welcome to taterSALAD's Tutorial on how to script for Halo CE!
Part I: Basic Scripting
What you will need for this tutorial:
Halo Custom Edition
Notepad
Sapien
Tool
Overview:
First we will begin with the obvious question, "What is a script?"
In Halo, a script is a command that tell the game to perform a certain task.
If you've ever used the console, or devmode, the commands that you used can be used in a script.
Scripts are just commands that are run automatically, and that you don't have to type the command.
If you've ever played the Single player levels, you would notice that scripts are everywhere.
Music, nav/waypoints, cutscenes, etc. are all the results of scripts.
The structure of a script is:
(script <script type> <return type> <script name>
<code>
)
Making Your First Script:
A basic script is in fact, very simple to make.
I'm assuming you already know how to make a custom map for Halo CE, and have your directories already set up.
Scripts always go in a special folder.
If you made a script for tutorial.map, this would be your directory:
Halo Custom Edition\data\levels\test\tutorial
Now create this folder:
Halo Custom Edition\data\levels\test\tutorial\scripts
OK, now we have a structure to work with. Now we will create the script.
In your scripts folder, create a new file. Rename it to "tutorial.hsc". .HSC is the format for a script, as Halo can't read
.txt files.

Open the tutorial.hsc in notepad.
First, type a "(". Scripts will always start with a "(".
Next, type the word, "startup". Startup tells Halo to run the script when the map is loaded.
Now, type the name of your script. In this tutorial, it will be called, "tutorial_script".

Now press the enter key to go to the next line.
Press Tab to go over some. I like using tab, because it helps keep the script organized.
Now type "(begin". This tells Halo that it is the beginning of the script.
Go to the next line, and tab twice. Type another "(".
In this tutorial, we will use the script to welcome the player to the server.
For those of you who don't know the console command for the server to speak, it is "sv_say <string>", where <string>
is what you want the server to say, in quotes. In this tutorial, the server will say "Welcome to the map" when the
player enters the map.
Still on the third line after the "(", type "sv_say "Welcome to the map")".

That's it for the command! Pretty easy, huh? Now all we have left to do in the script is close it off.
Press enter to go to the next line. Press Tab once. Now type a ")". This closes off the second line.
Now press enter again and now type another ")". This closes off the first line, and is the end of the script.

Compiling Your Script:
Now that the script is complete, we have to compile it into the map.
Open up tutorial.scenario in Sapien.
Use File>Save As, and save it as "script_test.scenario".
Now use File>Compile Scripts, or press Ctrl+Shift+C
If it worked, you will get a message like this one:

Now compile your map in tool, and play in Halo. If you know what your doing, you can use other commands,
such as "sv_ban New001" to keep anyone named New001 out of your map, and other fun stuff.
This tutorial only scratches the surface of what is possible by scripting.
If you want more, see Part II of taterSALAD's Scripting Tutorial